﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Input;

namespace UMLSynthesizer.EAUMLSynthesizerPlugin.ViewModel
{
    class SelectProjectViewModel : WorkspaceViewModel
    {
        #region Declarations

        public enum ExitActions { Open, Create, NoAction };

        #endregion

        #region Fields and RelayCommands

        RelayCommand _openCommand;
        RelayCommand _createNewCommand;

        #endregion

        #region Public interface

        public SelectProjectViewModel()
        {
            ExitAction = ExitActions.NoAction;
        }

        #endregion

        #region Properties

        public ExitActions ExitAction { get; private set; }

        #endregion

        #region Commands

        public ICommand OpenCommand
        {
            get
            {
                if (_openCommand == null)
                    _openCommand = new RelayCommand(param =>
                        {
                            ExitAction = ExitActions.Open;
                            CloseCommand.Execute(null);
                        });
                return _openCommand;
            }
        }
        public ICommand CreateNewCommand
        {
            get
            {
                if (_createNewCommand == null)
                    _createNewCommand = new RelayCommand(param =>
                        {
                            ExitAction = ExitActions.Create;
                            CloseCommand.Execute(null);
                        });
                return _createNewCommand;
            }
        }

        #endregion
    }
}
